home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ahoy 1988 September
/
Ahoy_Magazine_88-09_1988_Double_L.d64
/
Trap Shoot
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
2KB
|
61 lines
10 ifa=0thena=1:print"[147]"spc(11)"leave disk in drive":load"trap.sprts",8,1
20 poke53280,0:d$="":fort=1to40:d$=d$+"":c$=c$+" ":next:print"[147]"
30 gosub530:poke53281,14:print"[147][146] [164][175][185][185][184][183] [184][146][185][164]"spc(30)"[163][163][183][183][183][183][183][184][184][184][183]"
40 a$="[164][175][185][162][185][175][185][175]":fort=1to5:w$=w$+a$:next
50 printspc(21)"[145][164][175][175][185][162][184][163] [183][184][184][184][146][185][175][164]"spc(23)"[163][163][163][163][163][183][183][183][183][163][163][163][163]"
60 printspc(9)"[164][164][175][175][185][185][175][164][164] [164][175][175][185][185][185][175][175][164][164]"
70 printspc(6)"[155][164][164] [160][164][164][164] [164][164][175][164][164] [160][164][164] [164]"
80 a$=c$+c$:printleft$(d$,11)"[149]"w$"[159]"c$""a$"[159]"a$a$""a$a$a$;
90 v=53248:pokev+28,103:pokev+37,9:pokev+38,7:fort=0to6:readw,a
100 pokev+t+39,w:poke2040+t,a:next:fort=0to13:readw:pokev+t,w:next
110 fort=832to1023:poket,0:next:poke832,14:poke896,28:poke899,62:poke960,62
120 poke963,127:u=54272:pokeu+24,15:pokev+29,96
130 fort=0to4:reada$(t):next
140 iftt>29thenfort=1to600:next:goto430
150 fort=1to400:next:pokev+4,175:pokev+5,140:pokev+21,231:fort=1to1100:next
160 b=0:a=89:q=23:k=195:h%=rnd(1)*2:z=140:w%=rnd(1)*150+100:ae=3+df/2:s=0
170 h%=110+h%*145:ifh%=w%then160
180 gosub510:m=(k-z)/(h%-w%):b=k-m*h%:y=k:ab=rnd(.6)+.4:h=0:tt=tt+1
190 j=peek(56320):f=jand16:j=jand15:j=15-j:a=peek(v+4):w=peek(v+5)
200 print" [158] shells"tc-s"[157] [153] hit"ht"[157] of"tt-1"[157] [146] used"ts"[157] [145]"
210 c=0:d=0:ifjand4anda>97thenc=-gs
220 ifjand8anda<250thenc=gs
230 ifjand1andw>60thend=-gs
240 ifjand2andw<185thend=gs
250 iff<>16ands<tcthen330
260 pokev+4,peek(v+4)+c:pokev+5,peek(v+5)+d
270 ac=ac+1:ifac<3then190
280 ac=0:y=y-ae:x=(y-b)/m:w=15:ify<167thenw=14:ify<152thenw=13:ab=-abs(ab*1.1)
290 poke2043,w:poke2044,w:ifw<>14thenh=h+ab*(3+df/3)
300 ifh<0thenpokev+21,231:goto140
310 pokev+7,y-h:pokev+9,y:pokev+6,x:pokev+8,x:ae=ae*.93:pokev+21,255
320 pokev+4,peek(v+4)+c:pokev+5,peek(v+5)+d:goto190
330 pokev+21,235:pokev+1,201:s=s+1:ts=ts+1
340 q=28:a=3:w=8:gosub510:pokev+1,200
350 w=abs(peek(v+4)-x):a=peek(v+5)-y+h:c=15-peek(2043)
360 ifw>c*2andw<12-c*2anda>-14+c*2anda<-9then380
370 ac=2:pokev+21,255:goto260
380 pokev+6,x-9:pokev+7,y-8-h:fort=194to196
390 poke2043,t:forw=1to70:nextw,t:pokev+7,0:pokev+21,227:ht=ht+1:poke2043,15
400 goto140
410 data 2,192,,193,,198,1,13,0,13,0,197,0,197,175,200,175,221,,,,,,,92
420 data195,235,195,terrible,bad,about average,well,like a pro
430 poke53281,2:pokev+21,0:pokeu+24,0
440 w%=ht/tt*100:print"[147][158]"spc(6)"you shot"w%"[157]% of the targets."
450 a%=ht/ts*100:printspc(5)"of the shells fired,"a%"[157]% hit."
460 a$="you shoot "+a$((a%+w%)/50)+".":printspc(20-len(a$)/2)a$
470 print"":a$=" hit anything to continue [145]"
480 print"[158]"a$;
490 getb$:ifb$<>""thenclr:goto20
500 print"[155]"a$;:goto480
510 pokeu+4,0:pokeu+5,0:pokeu+4,128:pokeu+5,q:pokeu+1,a:pokeu,w:pokeu+4,129
520 return
530 df=1:tc=2:poke53281,7
540 print""spc(10)"1. difficulty "df
550 printspc(10)"2. "tc"shells per target"
560 printspc(10)"3. begin game"
570 geta$:a=val(a$):ifa=1thendf=df+1:ifdf=5thendf=1
580 ifa=2thentc=tc+1:iftc=5thentc=1
590 ifa=3thengs=3+df/2:return
600 goto540